# Maintainer: @naveen521kk on Github, Naveen M K <naveen521kk@gmail.com>

_perlname=Win32-Shortcut
_realname="${_perlname,,}"
pkgbase=mingw-w64-perl-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-perl-${_realname}")
pkgver=0.08
pkgrel=4
pkgdesc="Perl Module to deal with Windows Shortcuts (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url="https://metacpan.org/release/${_perlname}"
groups=("${MINGW_PACKAGE_PREFIX}-perl-modules")
depends=(
  "${MINGW_PACKAGE_PREFIX}-perl"
)
options=('!emptydirs')
makedepends=("${MINGW_PACKAGE_PREFIX}-python"
             "${MINGW_PACKAGE_PREFIX}-cc"
             $([[ ${MINGW_PACKAGE_PREFIX} != *-clang-* ]] || \
                echo "${MINGW_PACKAGE_PREFIX}-gcc-compat"))
license=('perl_5')
source=(
  "https://cpan.metacpan.org/authors/id/J/JD/JDB/${_perlname}-${pkgver}.tar.gz"
  "patchmakefile.py"
)
sha512sums=('ef9d656e4e9bae3798fc8543d40df70888f3144f560272f3e4a0dcc8d7247332a4348f75fc78539deda52092f9cacab1a6d589faa3d497ab2a3d1a922249c6c2'
            'd7ec5ba4a3d75f674f4028e8a53bc4177ab71a379bc63affebf910e1d5a0e491b6642318218b55ddc4d90e0125d61e4b97626782af57d44522bcb5543fb21cb2')

build() {
  cd "$srcdir/${_perlname}-${pkgver}"
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL
  export pkgdir=$pkgdir
  python $srcdir/patchmakefile.py
  mingw32-make
}

package() {
  cd "$srcdir/${_perlname}-${pkgver}"
  mingw32-make DESTDIR="${pkgdir}/" install
}
